const { $http, $fn, $ } = window

const Index = ({ onProject, tableRef }) =>{
	return ({
		label: '切换系统',
		cacheApi: 'project/dict',
		mode: 'dropdown',
		change: ({ value, label }) =>{
			$http.put(null, 'project/enabled', { id:value }).then(async ()=>{
				await  onProject()
				if( tableRef ) $.ref(tableRef).tableRef().search()
				$fn.msg.success(`已切换到【${label}】`)
			})
		}
	})
}
export default Index